package cn.iocoder.yudao.module.bpm.dal.mysql.oaleavapply;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.bpm.dal.dataobject.oaleavapply.OaLeavApplyDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.bpm.controller.admin.oaleavapply.vo.*;

/**
 * 申请单 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface OaLeavApplyMapper extends BaseMapperX<OaLeavApplyDO> {

    default PageResult<OaLeavApplyDO> selectPage(OaLeavApplyPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<OaLeavApplyDO>()
                .eqIfPresent(OaLeavApplyDO::getUserId, reqVO.getUserId())
                .eqIfPresent(OaLeavApplyDO::getReason, reqVO.getReason())
                .eqIfPresent(OaLeavApplyDO::getProcessInstanceId, reqVO.getProcessInstanceId())
                .betweenIfPresent(OaLeavApplyDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(OaLeavApplyDO::getBm, reqVO.getBm())
                .eqIfPresent(OaLeavApplyDO::getSqrq, reqVO.getSqrq())
                .eqIfPresent(OaLeavApplyDO::getZsc, reqVO.getZsc())
                .eqIfPresent(OaLeavApplyDO::getBpmDefKey, reqVO.getBpmDefKey())
                .eqIfPresent(OaLeavApplyDO::getMainForm, reqVO.getMainForm())
                .eqIfPresent(OaLeavApplyDO::getSubForm, reqVO.getSubForm())
                .eqIfPresent(OaLeavApplyDO::getTp, reqVO.getTp())
                .eqIfPresent(OaLeavApplyDO::getDjbh, reqVO.getDjbh())
                .eqIfPresent(OaLeavApplyDO::getDjrq, reqVO.getDjrq())
                .eqIfPresent(OaLeavApplyDO::getSqr, reqVO.getSqr())
                .eqIfPresent(OaLeavApplyDO::getSszj, reqVO.getSszj())
                .eqIfPresent(OaLeavApplyDO::getCdfydw, reqVO.getCdfydw())
                .eqIfPresent(OaLeavApplyDO::getCdfybm, reqVO.getCdfybm())
                .eqIfPresent(OaLeavApplyDO::getKsrq, reqVO.getKsrq())
                .eqIfPresent(OaLeavApplyDO::getJsrq, reqVO.getJsrq())
                .eqIfPresent(OaLeavApplyDO::getCfd, reqVO.getCfd())
                .eqIfPresent(OaLeavApplyDO::getDdd, reqVO.getDdd())
                .eqIfPresent(OaLeavApplyDO::getZje, reqVO.getZje())
                .eqIfPresent(OaLeavApplyDO::getXmid, reqVO.getXmid())
                .eqIfPresent(OaLeavApplyDO::getXmjlid, reqVO.getXmjlid())
                .eqIfPresent(OaLeavApplyDO::getSm, reqVO.getSm())
                .eqIfPresent(OaLeavApplyDO::getSn, reqVO.getSn())
                .eqIfPresent(OaLeavApplyDO::getStatus, reqVO.getStatus())
                .eqIfPresent(OaLeavApplyDO::getSqrbm, reqVO.getSqrbm())
                .eqIfPresent(OaLeavApplyDO::getSqrgh, reqVO.getSqrgh())
                .eqIfPresent(OaLeavApplyDO::getDeptId, reqVO.getDeptId())
                .likeIfPresent(OaLeavApplyDO::getNodeStatusName, reqVO.getNodeStatusName())
                .orderByDesc(OaLeavApplyDO::getId));
    }

}